<!--质检详情-->
<div class="wrap">
<div class="header">
	<span id="return">返回上一级</span>
</div>
<!--详情内容-->
<ul class="order_list">
	<li>
		<label>订单编号</label>
		<span id="orderNum"></span>
	</li>
	<li>
		<label>订单状态</label>
		<span id="orderStatus"></span>
	</li>
	<li>
		<label>产品名称</label>
		<span id="cpName"></span>
	</li>
	<li>
		<label>产品数量</label>
		<span id="cpNum"></span>
	</li>
	<li>
		<label>产品规格</label>
		<span id="cpSize"></span>
	</li>
	<li>
		<label>工艺要求</label>
		<span id="cpCraft"></span>
	</li>
	<li>
		<label>交货日期</label>
		<span id="orderDeadline"></span>
	</li>
	<li>
		<label>备注信息</label>
		<span id="orderComment"></span>
	</li>
	<li>
		<a href="javascript:void(0)" id="orderSubmit">确认</a>
	</li>
</ul>
</div>
<script>
//返回上一级
$("#return").on("click",function(){
	$("#main").empty();
	$.ajax({
		type:"get",
		url:"quality_check.html",
		success:function(res){
			$("#main").append(res);
		}
	});
})
var id = $.cookie("id");
$("#orderNum").text(id);
　　//订单详情
$.ajax({
	type:"post",
	url:"http://39.108.164.20/device/SysUser/TestList",
	dataType:"json",
	success:function(res){
		var data = res.result.data;
		for(let i=0;i<data.length;i++){
			if(id==data[i].order_id){
				$("#orderStatus").text(data[i].status);
				$("#cpName").text(data[i].cp_name);
				$("#cpNum").text(data[i].cp_num);
				$("#cpSize").text(data[i].cp_size);
				$("#cpCraft").text(data[i].cp_craft);
				$("#orderDeadline").text(data[i].order_deadline);
				$("#orderComment").text(data[i].order_comment);		
			}
		}
	}
});
//确认订单
$("#orderSubmit").on("click",function(){
	$.ajax({
		type:"post",
		url:"http://39.108.164.20/device/SysUser/SureOrder",
		dataType:"json",
		data:{
			order_id:id,
			type:"testSure"
		},
		success:function(res){
			alert(res.result.msg)
		}
	});
})
</script>
